package com.avantis.admin.controller;

import com.avantis.admin.service.RoleService;
import com.avantis.common.base.BaseController;
import com.avantis.common.msg.YResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: tracywang
 * @Date: 2019/1/26
 * @Descrption:
 */
@Api(value = "基础配置", description = "基础配置模块所有接口")
@RestController
@RequestMapping("/config")
public class BasicConfigController extends BaseController {

    @Autowired
    private RoleService roleService;

    @ApiOperation("权限---角色列表")
    @GetMapping("/findAllRoles")
    public YResult findAllRoles() {
        YResult result = restProcessor(() -> {
            Map<String,Object> resultMap=new HashMap<>();
            resultMap.put("roleList",roleService.findAll());
            return YResult.ok(resultMap);
        });
        return result;
    }
}
